﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Header.ascx.cs" Inherits="MyVocationSpace.Header" %>
<script src="js/jquery-1.7.2.js" type="text/javascript"></script>
<script src="js/jquery.bgiframe-2.1.2.js" type="text/javascript"></script>
<script src="js/jquery.ui.core.js" type="text/javascript"></script>
<script src="js/jquery.ui.widget.js" type="text/javascript"></script>
<script src="js/jquery.ui.mouse.js" type="text/javascript"></script>
<script src="js/jquery.ui.button.js" type="text/javascript"></script>
<script src="js/jquery.ui.position.js" type="text/javascript"></script>
<script src="js/jquery.ui.dialog.js" type="text/javascript"></script>
<script src="js/common.js" type="text/javascript"></script>
<link rel="stylesheet" href="http://jqueryui.com/themes/base/jquery.ui.all.css" />
<link rel="stylesheet" href="http://jqueryui.com/demos/demos.css" />
<link href="css/Popup.css" rel="stylesheet" type="text/css" />
<script src="js/Popup.js" type="text/javascript"></script>
<script src="js/Toggle.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {

        $('#menuul').children('li').mouseenter(function () {
            if ($(this).children('ul').hasClass('submenu')) {

                if ($(this).children('ul').attr('id') == 'homeMenu') {
                    $(this).children('ul').slideDown("fast");

                }
            };
            if ($(this).children('ul').hasClass('submenu')) {
                if ($(this).children('ul').attr('id') == 'JoinMenu') {
                    $(this).children('ul').slideDown("fast");
                }
            };
            // 

            // }
        }).mouseleave(function () {
            $('.submenu').slideUp("fast");

        });

        ActiveTopLink();
    });
    function ActiveTopLink() {
        $('#lnkLogin').hover(function () {

            $('#top-menu-container').toggleClass('top-menu-containerhover');
            $('#usermenu').children('ul').toggle();

        });
        $('#top-menu-container').hover(function () {

            $('#top-menu-container').toggleClass('top-menu-containerhover');
            $('#usermenu').children('ul').toggle();


        });

    }

</script>
<script type="text/javascript">
    function ValidAutho() {
        var email = $('#header_txtEmail').val();
        var Pass = $('#header_txtPass').val();

        if ((trim(email)) != "") {
            if (!validate(email)) {
                //for popupp
                $("#dialog:ui-dialog").dialog("destroy");
                $("#dialog-message").html('<div style=\"padding:10px\" class=\"ui-state-error ui-corner-all\">Invalid Email ID !</div>');
                $("#dialog-message").dialog({
                    modal: true,
                    buttons: {
                        Ok: function () {
                            $(this).dialog("close");
                        }
                    }
                });
                return false;
                //end popup
            }
        } else {
            $("#dialog:ui-dialog").dialog("destroy");
            $("#dialog-message").html('<div style=\"padding:10px\" class=\"ui-state-error\">Please Enter Your Email ID !</div>');
            $("#dialog-message").dialog({
                modal: true,
                buttons: {
                    Ok: function () {
                        $(this).dialog("close");
                    }
                }
            });
            return false;
        }
        if (trim(Pass) == "") {
            $("#dialog:ui-dialog").dialog("destroy");
            $("#dialog-message").html('<div style=\"padding:10px\" class=\"ui-state-error\">Please Enter Valid Password !</div>');
            $("#dialog-message").dialog({
                modal: true,
                buttons: {
                    Ok: function () {
                        $(this).dialog("close");
                    }
                }
            });
            return false;
        }
    }
    $(function () {
        // a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
        //  $("#dialog:ui-dialog").dialog("destroy");
        // $(this).dialog("close");
        $("#dialog-message").hide();

    });
</script>
<script type="text/javascript">
    function ErrorPopup(msg) {
        $("#dialog:ui-dialog").dialog("destroy");
        $("#dialog-message").html('<div style=\"padding:10px\" class=\"ui-state-error\">' + msg + '</div>');
        $("#dialog-message").dialog({
            modal: true,
            buttons: {
                Ok: function () {
                    $(this).dialog("close");
                }
            }
        });
        return false;
    }
</script>
<script type="text/javascript">
    function sendPassword() {
        var txtEmail = document.getElementById("txtEmailAdd").value;
        if (txtEmail != "") {
            if (validate(txtEmail)) {
                var xmlhttp;
                if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
                    xmlhttp = new XMLHttpRequest();
                }
                else {// code for IE6, IE5
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

                }
                xmlhttp.onreadystatechange = function () {
                    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {

                        document.getElementById("loading").style.display = "none";
                        document.getElementById("ErrorDiv").style.display = "block";
                        document.getElementById("ErrorDiv").innerHTML = xmlhttp.responseText;
                        document.getElementById("txtEmailAdd").value = "";
                    }
                }
                xmlhttp.open("POST", "AJAX/SendPassword.aspx?EmailID=" + txtEmail + "&type=0", true);
                xmlhttp.send();
                document.getElementById("loading").style.display = "block";
            }
            else {
                document.getElementById("div7").innerHTML = "Please enter valid Email ID.";
                toggleDiv('div7', 1);
                return false;
            }

        }
        else {
            document.getElementById("div7").innerHTML = "Please enter valid Email ID.";
            toggleDiv('div7', 1);
            return false;
        }
    }
    function clearOnFocus() {
        document.getElementById("idSpanMsg").style.display = "none";
    }
</script>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div class="Top-Header">
    <center>
        <div id="LogoDiv">
            <div id="logo">
                <a href="Home.aspx">
                    <img src="Images/Mainlogo.jpg" alt="My Vocation Space" width="210px" height="76px"
                        style="border: 0px" /></a>
            </div>
            <div class="top-menu" id="accountDiv" runat="server" style="visibility: hidden">
                <div id="top-menu-container">
                    <div id="profile">
                        <ul>
                            <li>
                                <asp:HyperLink ID="lnkLogin" NavigateUrl="MyProfile.aspx" runat="server" Font-Size="12px"
                                    Visible="false">My Profile</asp:HyperLink>&nbsp;<img src="Images/icon_dropdown.gif" visible="false"
                                        style="vertical-align: middle" runat="server" id="imgIndicator" height="12" width="12" />
                            </li>
                        </ul>
                        <%-- <span style="cursor: pointer;">--%>
                        <%-- <asp:LinkButton ID="lnkLogin" runat="server" CausesValidation="false" Font-Size="12px"
                            Visible="false" PostBackUrl="~/MyProfile.aspx"></asp:LinkButton>--%>
                        <%--   </span>--%>
                    </div>
                    <div id="usermenu">
                        <ul style="display: none;">
                            <li><a href="ChangePassword.aspx" id="lnkChngPass" style="font-size: 11px" runat="server"
                                visible="false">Change Password</a></li>
                            <li>
                                <asp:LinkButton ID="lnkLogout" runat="server" OnClick="SignOut" CausesValidation="false"
                                    Visible="false" Font-Size="12px">Sign Out</asp:LinkButton></li>
                            <li id="lnkApproveIndustry" runat="server" visible="false"><a href="ApproveIndustry.aspx"
                                style="font-size: 11px">Approve Industry</a></li>
                            <li id="lnkApproveVocation" runat="server" visible="false"><a href="ApproveVocation.aspx"
                                style="font-size: 11px">Approve Vocation</a></li>
                        </ul>
                    </div>
                </div>
                <div id="Myconnection">
                    <%-- My Connection--%>
                </div>
            </div>
        </div>
        <div style="clear: both">
        </div>
        <div id="navBar">
            <div style="float: left">
                <ul id="menuul">
                    <li><a href="Home.aspx">Home</a>
                        <ul class="submenu">
                            <li><a href="#">About</a></li>
                            <li><a href="#">About</a></li>
                        </ul>
                    </li>
                    <li id="lnkAbout" runat="server"><a href="WhatIsMVS.aspx?WhatIsMVS=2">What is in My
                        MVS?</a> </li>
                    <%-- <li id="lnkJoin" runat="server"><a href="#">Join Today</a> </li>--%>
                    <%--<li id="liProfile" runat="server" visible="false">
                        <asp:LinkButton ID="lnkProfile" runat="server" CausesValidation="false" Text="Profile"
                            PostBackUrl="~/MyProfile.aspx"></asp:LinkButton>
                        <div id="usermenuProfile">
                            <ul style="display: none">
                                <li>
                                    <asp:LinkButton ID="lnkEditProf" runat="server" PostBackUrl="~/EditProfile.aspx"
                                        CausesValidation="false" Font-Size="12px">Edit Profile</asp:LinkButton></li>
                                <li>
                                    <asp:LinkButton ID="lnkViewProf" runat="server" PostBackUrl="~/ViewProfile.aspx"
                                        CausesValidation="false" Font-Size="12px">View Profile</asp:LinkButton>
                                </li>
                            </ul>
                        </div>
                    </li>--%>
                    <%-- <li id="liInboxe" runat="server" visible="false" style="height: 15px">
                        <asp:LinkButton ID="lnkInbbox" runat="server" CausesValidation="false" Text="Inbox"></asp:LinkButton>
                    </li>--%>
                    <li id="liMyvocation" runat="server" visible="false">
                        <asp:LinkButton ID="lnkMyVocations" runat="server" PostBackUrl="MyVocation.aspx"
                            CausesValidation="false" Text="MyVocation"> </asp:LinkButton></li>
                    <li id="liCreateTopic" runat="server" visible="false"><a href="CreateTopic.aspx">Create
                        Topic</a> </li>
                    <li id="liMyDashBoard" runat="server" visible="false"><a href="MyDashboard.aspx">My
                        DashBoard</a> </li>
                </ul>
            </div>
            <div class="login">
                <%--For Error Popup--%>
                <div style="outline: 0px; height: auto; width: 300px; position: absolute; top: 216px;
                    left: 527px; z-index: 1002; display: none;" class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable ui-resizable"
                    tabindex="-1" role="dialog" aria-labelledby="ui-dialog-title-dialog-message">
                    <div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">
                        <span class="ui-dialog-title" id="ui-dialog-title-dialog-message">ERROR</span> <a
                            href="#" class="ui-dialog-titlebar-close ui-corner-all" role="button"><span class="ui-icon ui-icon-closethick">
                                close</span></a></div>
                    <div id="dialog-message" style="width: auto; min-height: 66px; height: auto;" class="ui-dialog-content ui-widget-content"
                        scrolltop="0" scrollleft="0">
                        <p>
                            <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;">
                            </span>
                        </p>
                    </div>
                </div>
                <%-- End Error Popup--%>
                <asp:UpdatePanel ID="upSignin" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <div class="logincontainer" id="logincontainer" runat="server">
                            <div>
                                <span>Email : </span><span>
                                    <asp:TextBox ID="txtEmail" runat="server" Width="117px" MaxLength="50"></asp:TextBox></span>
                            </div>
                            <div>
                                <span>Password : </span><span>
                                    <asp:TextBox ID="txtPass" runat="server" TextMode="Password" Width="117px" MaxLength="20"></asp:TextBox></span>
                            </div>
                            <div>
                                <asp:Button ID="btnLogin" runat="server" Text="Sign In" CssClass="formBtnEdit" CausesValidation="false"
                                    OnClick="btnLogin_Click" OnClientClick="return ValidAutho();" />
                            </div>
                        </div>
                        <div class="people-search" id="peoplesearch" runat="server" visible="false">
                            <div>
                                <span>People</span><span><asp:TextBox ID="txtSearchtext" runat="server" onfocus="if(this.value=='Search...')this.value='';this.style.color='#000';"
                                    onblur="if(this.value=='')this.value='Search...';this.style.color='#ccc';" Text="Search..."></asp:TextBox></span>
                                <span style="vertical-align: top">
                                    <asp:ImageButton ID="imgSearchBtn" runat="server" Width="25" ImageAlign="AbsMiddle"
                                        Height="24" CausesValidation="false" ImageUrl="~/Images/search-icon.jpg" OnClick="imgSearchBtn_Click" /></span>
                            </div>
                        </div>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnLogin" EventName="Click" />
                    </Triggers>
                </asp:UpdatePanel>
            </div>
        </div>
    </center>
</div>
<div style="clear: both">
</div>
<div class="content">
</div>
